﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;


namespace LoD.WPClientLibrary.Effects {
    public class SoundEffect {
        private readonly Game _game;
        private Microsoft.Xna.Framework.Audio.SoundEffect _effect;
        private SoundEffectInstance _instance;

        public SoundEffect(Game game) {
            this._game = game;
            this._effect = null;
            this._instance = null;
        }

        public void Load(string assetName) {
            this._effect = this._game.Content.Load<Microsoft.Xna.Framework.Audio.SoundEffect>(assetName);
            this._instance = this._effect.CreateInstance();
        }

        public void Play() {
            this._instance.Play();
        }
    }
}